#project > div.container > div.list > div > div:nth-child(2) > a > div.mainbox > div.info > div:nth-child(1) > div.name
import requests
from bs4 import BeautifulSoup

#http://rrkf.com/serv/request?entityCount=347&maxEntityPerPage=10&maxPagePerRow=5&pageCount=35&currentPage=2&currentPageRow=1
# &pageRowCount=7&cBudget=0-1000000000&budgetTo=&statusBy=&categoryBy=&typeBy=&typeName=&orderByClause=a.c_postDate+desc

class CodeMarket:
    def __init__(self):
        self.URL = 'https://www.yuanjisong.com/job/allcity/page351'
        #self.header = { 'User-Agent' : 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36'}
        self.header = { 'User-Agent' : 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36', 'charset' : 'utf-8' }

    def get_project(self):
        #page = str(page)
        #html = requests.get(self.URL, params={'page': page}, headers = self.header)
        #currentPage=1&pageSize=100
        #html = requests.get(self.URL,         params = {"currentPage": "1", "pageSize": "100"}, headers = self.header)
        html = requests.get(self.URL, headers=self.header)
        #print(html.headers['content-type'])
        #print(html.encoding)
        #print(html.apparent_encoding)
        #print(requests.utils.get_encodings_from_content(page_content.text))
        #html.content.decode("utf-8")
        #html.content.decode("GB2312")
        #html = html.content.encode('utf-8')


        html.content.decode('utf-8')
        print(html.text)

        soup = BeautifulSoup(html.text, "html.parser")
        #print(soup.get_text())
        #for i in range(1,16):
        #    name = soup.select('project > div.container > div.list > div > div:nth-child('+ str(i)+ ') > a > div.mainbox > div.info > div:nth-child(1) > div.name')
        #    #name = soup.select(' #projectLists > div > ul > li:nth-child(2) > div.left_8 > h4 > a ')
        #    ##projectView > div:nth-child(6) > div > div.col-xs-12.col-md-12.project-bg > div:nth-child(2) > div.col-xs-12.col-md-12.project-name.ng-binding
        #    print(name)

if __name__ == "__main__":
    cls = CodeMarket()
    cls.get_project()